#pragma once

#include "RendererTypes.hpp"

#include "AxisAlignedBox.hpp"
#include "Vectors.hpp"
#include <boost/noncopyable.hpp>

namespace cge {
	class Visible: boost::noncopyable {
	public:
		virtual ~Visible();
		virtual const AxisAlignedBox& getBoundingBox() = 0;

		bool    isOccluded() const  { return occluded_; }
		bool    isRendered()  const { return rendered_;  }
		FrameId getFrameId() const  { return frame_;    }
		Octree* getOctree()  const  { return octree_;   }

		void    render( FrameId newFrameId );
		void    renderBox();

		void    resink();

	protected:
		Visible(): octree_(0), occluded_(false), rendered_(true), frame_(0) {}
	
		virtual void performRender() = 0;

	private:
		friend class Octree;

		Octree*     octree_;
		VisibleIter iter_;
		bool        occluded_;
		bool        rendered_;
		FrameId     frame_;
	};
}